package com.hyzh.latte.hj.enterprise;

import com.coffee.core.CoffeeEnum;

/**
 * @author songkui
 * @since 2024/5/8 18:08
 */
public enum CommandTypeEnum implements CoffeeEnum<Integer> {
    SCENE(1, "现场机状态"),
    UPPER(2, "上位机状态"),
    DATA(3, "检查数据");

    private final Integer code;
    private final String label;

    CommandTypeEnum(Integer code, String label){
        this.code = code;
        this.label = label;
    }


    @Override
    public Integer code() {
        return this.code;
    }

    @Override
    public String label() {
        return this.label;
    }

    public static CommandTypeEnum ofCode(Integer code) {
        for (CommandTypeEnum genderEnum : values()) {
            if (genderEnum.code.equals(code)) {
                return genderEnum;
            }
        }
        return null;
    }


}
